package cn.com.yx.ms.controller;

import cn.com.yx.ms.service.ISysService;
import cn.yx.framework.configuration.AppConstant;
import cn.yx.framework.view.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 应用中心
 */
@RestController
@RequestMapping(value = "/")
@Api(value = "菜单接口", description = "组织结构-部门相关操作接口")
public class MenuController {

    private static final Logger logger = LoggerFactory.getLogger(MenuController.class);

    @Resource
    private MessageSource messageSource;

    @Resource
    private ISysService iSysService;


    @ResponseBody
    @RequestMapping(value = "menus/{userid}", method = RequestMethod.GET)
    @ApiOperation("获取所有部门信息")
    public ApiResult find(@PathVariable("userid") String userid, HttpServletRequest request) {

        return new ApiResult<>(AppConstant.MSG_SUCCESS, iSysService.findMenus(userid));

    }

}